public class SumOfReturned {
    static int sum = 0;
    public static int Sum(int n) {
        if (n < 10) {
            return n;
        }
        return n % 10 + Sum(n/10);
    }


    public static void main(String[] args) {
        System.out.println(Sum(4223));
    }
}
